/*
 * @Author: Starfish_DL
 * @Date: 2020-11-09 21:34:03
 * @LastEditors: Starfish_DL
 * @LastEditTime: 2020-11-10 00:59:57
 * @CurrentVersion: 1.0
 * @Description: 
 */

#ifndef CLINKTREE_H
#define CLINKTREE_H
#define MAXSIZE 50
#include <string>

class CSqBinTree
{
public:
    char data[MAXSIZE];
    int length;
    CSqBinTree(string str);
    ~CSqBinTree();
};

class CNode
{
public:
    char data;
    CNode *leftchild;
    CNode *rightchild;
    CNode(char a);
    CNode(char a, CNode *l, CNode *r);
    ~CNode();
};

class CLinkTree
{
public:
    CNode *head = nullptr;
    CLinkTree(string str);
    CLinkTree(CSqBinTree t);
    int Height();
    void DispTree();
    ~CLinkTree();
};

void CreateTree(CNode *n, int i, CSqBinTree tree);
int height(CNode *n);
void DestroyTree(CNode *n);
void dispTree(CNode *n);

#endif // !CLINKTREE_H
